package com.hqyj.dao;

import com.hqyj.pojo.MyNode;
import com.hqyj.pojo.UserInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author rock
 * @since 2023-10-07
 */
public interface UserInfoMapper extends BaseMapper<UserInfo> {


    @Select("SELECT r.role_name from user_info u INNER JOIN user_role_relation urr \n" +
            "on u.user_id = urr.user_id INNER JOIN role_info r\n" +
            "on r.role_id = urr.role_id \n" +
            "where user_name=#{userName}")
    List<String> queryRoleByUserName(String userName);

    //根据用户名查询用户的权限信息
    List<MyNode> queryPowerByUserName(String userName);


}
